package com.ljsw.dialog;

import com.ljsw.activity.R;

import android.app.Dialog;
import android.content.Context;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;

public class TiShiDialog {
	public TiShiDialog(Context context) {
		super();
		this.context = context;
		WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
		display = windowManager.getDefaultDisplay();//获取屏幕分辨率
	}
	private Context context;
	private Display display;
	private Dialog dialog;
	private TextView loadlogin;
	private ImageView image;
	
	public TiShiDialog builder(){
		View view = LayoutInflater.from(context).inflate(R.layout.dialog_tishi, null);
		loadlogin = (TextView) view.findViewById(R.id.text_tishi);
		image = (ImageView) view.findViewById(R.id.image_tishi);
		//给图片添加动态效果
		// 添加Dialog样式
		dialog = new Dialog(context, R.style.LoginDialog);
		dialog.setContentView(view);
		dialog.setCanceledOnTouchOutside(false);// 设置点击Dialog外部任意区域不关闭Dialog	
		// 调整dialog背景大小
	//	lLayout_load.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		return this;
	}
		
	public TiShiDialog setMessage(String text){
		loadlogin.setText(text);
		return this;
	}
	
	public void show(){
		dialog.show();
	}
	public void dismiss(){
		dialog.dismiss();
	}
}
